<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>
</head>
<body>
    <div id="app">
        {{message | capitalize}}
    </div>
    <script>
        new Vue({
            el: '#app',
            data: {
	        message: 'runoob'
        },
        filters: {
            capitalize: function(value){
                if(!value) return ''
                value = value.toString()
                return value.charAt(0).toUpperCase() + value.slice(1)//对输入的字符串第一个字母转为大写
            }
        }
        })
    </script>
</body>
</html>